<!DOCTYPE html>
<html>
<head>
	<!-- 公共页面 -->
	#include("../include/common.html")
	<!-- 公共页面 /-->
</head>
<body class="hold-transition skin-purple sidebar-mini">
    <div class="wrapper">
        <!-- 页面头部 -->
        #include("../include/header.html")
        <!-- 页面头部 /-->
        <!-- 导航侧栏 -->
        #include("../include/menu.html")
        <!-- 导航侧栏 /-->
        <!-- 内容区域 -->
        <div class="content-wrapper" id="contentDiv">
            <!-- 正文区域 -->
            <section class="content">
       			<form id="inputForm">
           		<input type="hidden" name="id" value="#(company.id)">
   	        	<div class="box-body">
	            	<!--tab页-->
		            <div class="nav-tabs-custom">
		                <!--tab头-->
		                <ul class="nav nav-tabs">
		                    <li class="active"><a href="#tab-pic" data-toggle="tab">公司信息</a></li>
		                </ul>
		                <!--tab头/-->
		                <!--tab内容-->
		                <div class="tab-content">
		                    <div class="tab-pane active" id="tab-basic">
			                    <div class="row data-type">
			                        <div class="col-md-2 title">公司名称</div>
			                        <div class="col-md-10 data">
			                            <input type="text" class="form-control" placeholder="公司名称" name="name" value="#(company.name)">
			                        </div>
			                        <div class="col-md-2 title">公司地址</div>
			                        <div class="col-md-10 data">
			                            <input type="text" class="form-control" placeholder="公司地址" name="address" value="#(company.address)">
			                        </div>
			                        <div class="col-md-2 title">邮政编码</div>
			                        <div class="col-md-10 data">
			                            <input type="text" class="form-control" placeholder="邮政编码" name="postcode" value="#(company.postcode)">
			                        </div>
			                        <div class="col-md-2 title">联系人</div>
			                        <div class="col-md-10 data">
			                            <input type="text" class="form-control" placeholder="联系人" name="contact" value="#(company.contact)">
			                        </div>
			                        <div class="col-md-2 title">手机号码</div>
			                        <div class="col-md-10 data">
			                            <input type="text" class="form-control" placeholder="手机号码" name="mobile" value="#(company.mobile)">
			                        </div>
			                        <div class="col-md-2 title">电话号码</div>
			                        <div class="col-md-10 data">
			                            <input type="text" class="form-control" placeholder="电话号码" name="phone" value="#(company.phone)">
			                        </div>
			                        <div class="col-md-2 title">传真号码</div>
			                        <div class="col-md-10 data">
			                            <input type="text" class="form-control" placeholder="传真号码" name="fax" value="#(company.fax)">
			                        </div>
			                        <div class="col-md-2 title">电子邮箱</div>
			                        <div class="col-md-10 data">
			                            <input type="text" class="form-control" placeholder="电子邮箱" name="email" value="#(company.email)">
			                        </div>
			                        <div class="col-md-2 title">QQ号码</div>
			                        <div class="col-md-10 data">
			                            <input type="text" class="form-control" placeholder="QQ号码" name="qq" value="#(company.qq)">
			                        </div>
			                        <div class="col-md-2 title" style="height: 170px;">微信图标</div>
			                        <div class="col-md-10 data" style="height: 170px;" type="file">
			                        	<div class="row" style="margin-left: 0px;margin-right: 0px;">
				                        	<div class="col-md-3 padding-clear">
					                            <input type="text" class="form-control" placeholder="微信图标" name="weixin" value="#(company.weixin)">
				                        	</div>
				                        	<div class="col-md-2" style="padding-right: 0px;">
				                        		<div id="weixinFilePicker" style="float: right;">选择文件</div>
				                        	</div>
			                        	</div>
			                        	<div class="row" style="margin-left: 0px;margin-right: 0px;">
			                        		<div class="pic picbox">
			                        			<dl>
													<dt><a href="javascript:;"><img src="#(company.weixin)" onerror="javascript:this.src='#(base)/static/images/nopic.jpg';" class="preview"/></a></dt>
													<dd>删除</dd>
												</dl>
			                   				</div>
			                        	</div>
			                        </div>
			                        <div class="col-md-2 title" style="height: 170px;">H5图标</div>
			                        <div class="col-md-10 data" style="height: 170px;" type="file">
			                        	<div class="row" style="margin-left: 0px;margin-right: 0px;">
				                        	<div class="col-md-3 padding-clear">
					                            <input type="text" class="form-control" placeholder="H5图标" name="h5" value="#(company.h5)">
				                        	</div>
				                        	<div class="col-md-2" style="padding-right: 0px;">
				                        		<div id="h5FilePicker" style="float: right;">选择文件</div>
				                        	</div>
			                        	</div>
			                        	<div class="row" style="margin-left: 0px;margin-right: 0px;">
			                        		<div class="pic picbox">
			                        			<dl>
													<dt><a href="javascript:;"><img src="#(company.h5)" onerror="javascript:this.src='#(base)/static/images/nopic.jpg';" class="preview"/></a></dt>
													<dd>删除</dd>
												</dl>
			                   				</div>
			                        	</div>
			                        </div>
			                        <div class="col-md-2 title" style="height: 170px;">APP图标</div>
			                        <div class="col-md-10 data" style="height: 170px;" type="file">
			                        	<div class="row" style="margin-left: 0px;margin-right: 0px;">
				                        	<div class="col-md-3 padding-clear">
					                            <input type="text" class="form-control" placeholder="APP图标" name="h5" value="#(company.app)">
				                        	</div>
				                        	<div class="col-md-2" style="padding-right: 0px;">
				                        		<div id="appFilePicker" style="float: right;">选择文件</div>
				                        	</div>
			                        	</div>
			                        	<div class="row" style="margin-left: 0px;margin-right: 0px;">
			                        		<div class="pic picbox">
			                        			<dl>
													<dt><a href="javascript:;"><img src="#(company.app)" onerror="javascript:this.src='#(base)/static/images/nopic.jpg';" class="preview"/></a></dt>
													<dd>删除</dd>
												</dl>
			                   				</div>
			                        	</div>
			                        </div>
			                        <div class="col-md-2 title">营业执照代码</div>
			                        <div class="col-md-10 data">
			                            <input type="text" class="form-control" placeholder="营业执照代码" name="blicense" value="#(company.blicense)">
			                        </div>
			                        <div class="col-md-2 title">其它信息</div>
			                        <div class="col-md-10 data">
			                            <input type="text" class="form-control" placeholder="其它信息" name="other" value="#(company.other)">
			                        </div>
			                    </div>
		                    </div>
			                <!--工具栏-->
			                <div class="box-tools text-center">
			                    <button type="submit" class="btn bg-maroon">保存</button>
			                    <button type="button" class="btn bg-default" onclick="history.back(-1);">返回</button>
			                </div>
			                <!--工具栏/-->
	                	</div>
	                	<!--tab内容/-->
	                </div>
	                <!--tab页/-->
               	</div>
              	</form>
            </section>
            <!-- 正文区域 /-->
        </div>
        <!-- 内容区域 /-->
        <!-- 底部导航 -->
        #include("../include/footer.html")
        <!-- 底部导航 /-->
    </div>
</body>
</html>
<!---->
<script>
 $(document).ready(function() {
     // 激活导航位置
     setSidebarActive("admin-company");
 });
</script>
<script type="text/javascript">
$().ready(function() {

	var $inputForm = $("#inputForm");
	var $weixinFilePicker = $("#weixinFilePicker");
	var $h5FilePicker = $("#h5FilePicker");
	var $appFilePicker = $("#appFilePicker");
	
	$weixinFilePicker.uploader();
	$h5FilePicker.uploader();
	$appFilePicker.uploader();
	
	$("#inputForm").submit( function() {
		$.ajax({
	        url: "#(base)/admin/company/update",
	        type: "POST",
	        data: $("#inputForm").serialize(),
	        dataType: "json",
	        cache: false,
	        success: function(response) {
	            if (response.type == "success") {
	            	swal({title:'', text:'操作成功',icon: 'success'});
	            }else{
	                swal({title:'', text:response.msg,icon: 'error'});
	            }
	        }
	    });
		return false;
	});

});
</script>